/*
 *  AudioProjectSetting.h
 *
 *
 *  Created by Peter on 23.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef A_AUDIO_PROJECT_SETTING_H
#define A_AUDIO_PROJECT_SETTING_H

#include "ASetting.h"

/*
 * Audio Project Settings.
 *
 *  Avid Class Name: AudioProjectSetting
 * Avid Type String: "Audio Project"
 *          Version: 1 (MC 5.5 OS X)
 */
class AudioProjectSetting : public ASetting
{

public:

	A_DECLARE_CLASS( 'AUDP', AudioProjectSetting, ASetting );

	void readFromStream( AStream& str, const AObjDoc& objd );

	// ----- data members -----

	// These are almost verbatim from a system dump file
	UInt32 _iBaseSampleRate; // 48000
	/*long             AudioProjectSetting_SyncSource: -1
	 long             AudioProjectSetting_InputSource: 0
	 long             AudioProjectSetting_DigitalFormat: 0
	 long             AudioProjectSetting_iReferenceLevel: -20
	 long             AudioProjectSetting_iCalToneFreq: 1000
	 double           AudioProjectSetting_iCalToneLevelInDBs: -20.00000000
	 long             AudioProjectSetting_InputGainAttenuation: -1
	 Boolean          AudioProjectSetting_IsProLevelOn: True // I think this is stored as 1 byte
	 Minor Version   : 1 // Can't seem to figure out what this is all about
	 string           AudioProjectSetting_InputSourceName: "no source"
	 Minor Version   : 2
	 long             AudioProjectSetting_SampleRateConvQualityLevel: 1
	 Minor Version   : 3
	 Boolean          AudioProjectSetting_SampleRateConvDuringPlay: True*/
};

void AudioProjectSetting::readFromStream( AStream& str )
{
	ASetting::readFromStream( str );

	UInt8 v1, v2;

	// Read the version indicator
	str.readPod( v1 );
	str.readPod( v2 );

	// Check if the version is right
	TR_ASSERT( v1 == 0x02 );
	TR_ASSERT( v2 == ???? );

	// Read all the data members
	str.readPod( _iBaseSampleRate );
	// ...
}

#endif /*Inclusion Gurad*/
